app.controller('GetfaultlistCtrl',function ($scope,$http,$localStorage,$location,$window,$state) {
	$scope.namedata = $localStorage.cur_user.uname;	      
      $scope.currentPage = 1;//初始当前页
      $scope.maxSize = 3;//最多显示3页其他的用···代替
      $http.post(
        $scope.app.backendurl+"tbl-break-down/view-all",
        {    
          'page': $scope.currentPage,
          'token':$localStorage.token                  

        }
        ).success(function (data) {
            //console.log(data);
            if(data.code==0&&data.msg=="读取成功"){ 
              $scope.aaData = data.data.list; 
              $scope.totalItems = data.data.page.totalCount; 

              $scope.pageChanged = function(){
                $http.post(
                    $scope.app.backendurl+"tbl-break-down/view-all",
                    {    
                      'page': $scope.currentPage,
                      'token':$localStorage.token                  

                    }
                    ).success(function (data) {
                        //console.log(data);
                        if(data.code==0&&data.msg=="读取成功"){ 
                           $scope.aaData = data.data.list; 
                        }
                        if(data.code==1){             
                          alert(data.msg)
                                
                        }
                        if(data.code==20001&&data.msg=='请先登录'){
                          $location.path('access.signin');
                        }  
                      }).error(function(data){
                        console.log(data);
                      })
              }        
              // alert(data.msg);
              // $state.go('app.control.electricquantity')               
            }
            if(data.code==1){             
              alert(data.msg)
                    
            }
            if(data.code==20001&&data.msg=='请先登录'){
              $location.path('access.signin');
            }  
         
       
        }).error(function(data){
          console.log(data);
        })


  

	


	

})